package org.io4j.util;

public final class Argument {

	private Argument() {
	}

	public static void is(boolean condition, String message) {
		if (!condition) {
			throw new IllegalArgumentException(message);
		}
	}

	public static void isNot(boolean condition, String message) {
		if (condition) {
			throw new IllegalArgumentException(message);
		}
	}

	public static void isNull(Object argument, String message) {
		if (argument != null) {
			throw new IllegalArgumentException(message);
		}
	}

	public static void isNotNull(Object argument, String message) {
		if (argument == null) {
			throw new IllegalArgumentException(message);
		}
	}

	public static void isNotEmpty(String argument, String message) {
		if (argument == null || argument.isEmpty()) {
			throw new IllegalArgumentException(message);
		}
	}
}
